<!DOCTYPE html>
<!--压制HTML中文件的警告或者错误（只有当前文件中设置生效）-->
<!-- suppress ThymeleafVariablesResolveInspection -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"
                xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<!--左侧导航-->
<aside class="lyear-layout-sidebar" th:fragment="leafsiderbar">
    <script type="text/javascript" src="asserts/js/perfect-scrollbar.min.js" th:src="@{/asserts/js/perfect-scrollbar.min.js}"></script>
    <script type="text/javascript" src="asserts/js/main.min.js" th:src="@{/asserts/js/main.min.js}"></script>
    <!-- logo -->
    <div id="logo" class="sidebar-header">
        <a href="/index" th:href="@{/main}"><img src="asserts/images/logo-sidebar.png" th:src="@{/asserts/images/logo-sidebar.png}" title="LightYear" alt="LightYear" /></a>
    </div>
    <div class="lyear-layout-sidebar-scroll">
        <nav class="sidebar-main">
            <ul class="nav nav-drawer">

                <li id="index" class="nav-item nav-item-has-subnav" > <a href="main" th:href="@{/main}"><i class="mdi mdi-home"></i>主页</a> </li>
                <!--用户需要权限VIP1-->
                <li id="management" class="nav-item nav-item-has-subnav" sec:authorize="hasAuthority('VIP1')">
                    <a href="javascript:void(0)"><i class="mdi mdi-settings"></i>系统管理</a>
                    <ul class="nav nav-subnav" >
                        <li id="menu"> <a href="system/management/menu" th:href="@{/system/management/menu}"><i class="mdi mdi-server"></i>菜单管理</a> </li>
                        <li id="user"> <a href="system/management/user" th:href="@{/system/management/user}"><i class="mdi mdi-account"></i>用户管理</a> </li>
                        <li id="role"> <a href="system/management/role" th:href="@{/system/management/role}"><i class="mdi mdi-account-card-details">角色管理</i></a> </li>
                    </ul>
                </li>
                <!--用户需要权限VIP2-->
                <li id="monitor" class="nav-item nav-item-has-subnav" sec:authorize="hasAuthority('VIP2')">
                    <a href="javascript:void(0)"><i class="mdi mdi-security"></i> 系统监控</a>
                    <ul class="nav nav-subnav">
                        <li id="log"><a href="system/monitor/log" th:href="@{/system/monitor/log}"><i class="mdi mdi-message-text-outline">系统日志</i></a> </li>
                        <li id="interface"> <a href="system/monitor/interface" th:href="@{/system/monitor/interface}"><i class="mdi mdi-key">接口api</i></a> </li>
                        <li id="sql"> <a href="system/monitor/sql" th:href="@{/system/monitor/sql}"><i class="mdi mdi-message-video">数据监控</i></a></li>
                        <li id="tasks"> <a href="system/monitor/tasks" th:href="@{/system/monitor/tasks}"><i class="mdi mdi-timer">定时任务</i></a></li>
                    </ul>
                </li>

            </ul>
        </nav>
        <!--     页尾 -->
        <div class="sidebar-footer">
            <p class="copyright">Copyright © 2020 ZHANBO. All rights reserved.
        </div>
    </div>
    <script>
        var pathname = window.location.pathname;
        //主页
        if(pathname.indexOf("main") != -1){
            $('#index').addClass('active')
        }
        //系统管理
        if (pathname.indexOf("management") != -1) {
            $("#management").addClass("active open");
            if(pathname.indexOf("management/menu")!=-1){
                $("#menu").addClass("active");
            }
            if(pathname.indexOf("management/user") !=-1){
                $("#user").addClass("active");
            }
            if(pathname.indexOf("management/role")!=-1){
                $("#role").addClass("active");
            }
        }
        //系统监控
        if (pathname.indexOf("monitor") != -1) {
            $("#monitor").addClass("active open");
            if(pathname.indexOf("monitor/log")!=-1){
                $("#log").addClass("active");
            }
            if(pathname.indexOf("monitor/interface")!=-1){
                $("#interface").addClass("active");
            }
            if(pathname.indexOf("monitor/sql")!=-1){
                $("#sql").addClass("active");
            }
            if(pathname.indexOf("monitor/tasks")!=-1){
                $("#tasks").addClass("active");
            }
        }
    </script>
</aside>
<!--End 左侧导航-->
</html>